<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
  <script>
        //时间对象
        //只能用new来创建 
        var date=new Date()

        date.setFullYear('2025')
        //设置月份的时候，记得减一
        date.setMonth('10')
        date.setDate('10')

        //年
        console.log(date.getFullYear())
        //月
        console.log(date.getMonth()+1)
        //日
        console.log(date.getDate())
        //小时
        console.log(date.getHours());
        //分钟
        console.log(date.getMinutes())
        //秒
        console.log(date.getSeconds());


        //获取时间戳
        //作为
        console.log(date.getTime());


        console.log(date);

    </script>
</body> 
</html>